Adding max block device timeout of 30 secs for live migrate.
authorjchesterfield@wicket.uk.xensource.com <jchesterfield@wicket.uk.xensource.com>
Fri, 15 Sep 2006 17:48:24 +0000 (18:48 +0100)
committerjchesterfield@wicket.uk.xensource.com <jchesterfield@wicket.uk.xensource.com>
Fri, 15 Sep 2006 17:48:24 +0000 (18:48 +0100)
tools/python/xen/xend/XendDomainInfo.py

index 259aaab331d3179c4001f62942128e5c0ce1b9d6..598efc7c918ad9316f9a5da9942f0448ae1d0f98 100644 (file)
@@ -86,6 +86,7 @@ STATE_DOM_OK       = 1
 STATE_DOM_SHUTDOWN = 2
 
 SHUTDOWN_TIMEOUT = 30.0
+MIGRATE_TIMEOUT = 30.0
 
 ZOMBIE_PREFIX = 'Zombie-'
 
@@ -1535,8 +1536,10 @@ class XendDomainInfo:
         the device has shutdown correctly, i.e. all blocks are
         flushed to disk
         """
+        start = time.time()
         while True:
             test = 0
+            diff = time.time() - start
             for i in self.getDeviceController('vbd').deviceIDs():
                 test = 1
                 log.info("Dev %s still active, looping...", i)
@@ -1544,6 +1547,9 @@ class XendDomainInfo:
                 
             if test == 0:
                 break
+            if diff >= MIGRATE_TIMEOUT:
+                log.info("Dev still active but hit max loop timeout")
+                break
 
     def migrateDevices(self, network, dst, step, domName=''):
         """Notify the devices about migration